package com.allianz.webapps.controllers;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.allianz.frame.utils.PropertiesUtil;

@Controller
@RequestMapping(value="main")
public class AutoUpdateController {

	@RequestMapping(value="getVersionInfo")
	@ResponseBody
	public Map<String,String> getVersionInfo(HttpServletRequest request,HttpServletResponse response){
		Map<String,String> map = new HashMap<String, String>();
		map.put("version", PropertiesUtil.getVersion());
		map.put("appDownloadUrl", PropertiesUtil.getAppDownloadUrl()+"?"+System.currentTimeMillis());
		map.put("appUpdateMsgs", PropertiesUtil.getAppUpdateMsgs());
		return map;
	}
}
